/* ==================================================================   
 * Created [2009-4-27 下午11:32:55] by Jon.King 
 * ==================================================================  
 * TSS 
 * ================================================================== 
 * mailTo:jinpujun@hotmail.com
 * Copyright (c) Jon.King, 2009-2012 
 * ================================================================== 
 */

package com.jinhe.tss.component.recycle.entity;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import com.jinhe.tss.core.persistence.IEntity;
import com.jinhe.tss.core.web.dispaly.grid.GridAttributesMap;
import com.jinhe.tss.core.web.dispaly.grid.IGridNode;

/**
 * <p> Recycle.java </p>
 * <p> 
 * 回收站垃圾信息Recycle实体类。 每次删除都会产生一条回收信息。
 * </p>
 */
@Entity
@Table(name = "component_recycle")
@SequenceGenerator(name = "recycle_sequence", sequenceName = "recycle_sequence", initialValue = 1000, allocationSize = 10)
public class Recycle implements IEntity, IGridNode {
    
    public static final Integer TRUE  = new Integer(1); //逻辑已删除的状态
    public static final Integer FALSE = new Integer(0); //逻辑未删除的状态

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "recycle_sequence")
	private Long    id;				// 主键
	private Long    nodeId;			// 结点ID： 被删除实体的ID
	private Long    nodepId;		// 辅助ID
	private String  nodeName;		// 结点名： 被删除实体的名称
	private String  entityClass;    // 表  名： 实体类路径
	private Integer typeId;			// 垃圾类型编号
	private String  typeName;		// 垃圾类型名称
    
	private Date    deleteDate;		// 删除日期
	private Long    userId;			// 操作者ID
	private String  userName;		// 操作者姓名
	
	@Lob
	@Basic(fetch = FetchType.LAZY)
	private String  params;		   //执行删除操作时的参数：dao的删除方法的参数
	private String  methodName;    //执行删除操作时调用的方法：dao的删除方法名
	private String  beanId;        //执行删除操作的类对应的BEAN的ID：一般为Dao对象

	public GridAttributesMap getAttributes(GridAttributesMap map) {
        map.put("id", id);
        map.put("nodeId", nodeId);
        map.put("nodeName", nodeName);
        map.put("entityClass", entityClass);
        map.put("typeId", typeId);
        map.put("typeName", typeName);
        map.put("deleteDate", deleteDate);
        map.put("userId", userId);
        map.put("userName", userName);
        return map;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getNodeId() {
        return nodeId;
    }

    public void setNodeId(Long nodeId) {
        this.nodeId = nodeId;
    }

    public Long getNodepId() {
        return nodepId;
    }

    public void setNodepId(Long nodepId) {
        this.nodepId = nodepId;
    }

    public String getNodeName() {
        return nodeName;
    }

    public void setNodeName(String nodeName) {
        this.nodeName = nodeName;
    }

    public String getEntityClass() {
        return entityClass;
    }

    public void setEntityClass(String entityClass) {
        this.entityClass = entityClass;
    }

    public Integer getTypeId() {
        return typeId;
    }

    public void setTypeId(Integer typeId) {
        this.typeId = typeId;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public Date getDeleteDate() {
        return deleteDate;
    }

    public void setDeleteDate(Date deleteDate) {
        this.deleteDate = deleteDate;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getParams() {
        return params;
    }

    public void setParams(String params) {
        this.params = params;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public String getBeanId() {
        return beanId;
    }

    public void setBeanId(String beanId) {
        this.beanId = beanId;
    }
}
